|
|
|
|
|
|
|
based on the INI file header value represented by the argument argHeader and the name of the item held in the argument, argName. For instance, if you have an INI file with a header such as User Preferences, you might then have an item with the name Favorite Font Name. Passing these two values in results in the actual font name. The getSettings method is a convenient method for getting every setting in the INI file. |
|
|
|
|
|
|
|
|
Logging User Interactions with the Application |
|
|
|
|
|
|
|
|
Over the life of your application, your user will make a combination of significant and not-so-significant transactions. Depending on your particular situation, you might opt to track every transaction or just the important ones. Of all the user transactions, the most important ones tend to be those that involve logging in and out of an application and interacting with database records. |
|
|
|
|
|
|
|
|
Undo operations are also important for auditing purposes, at least as a training tool for managers and new employees. In addition, you might want to record the user's ID, start time of transaction, end time of transaction, and possibly the identifier for the transaction or task the user performed. A sequence of these transactions leaves a nice audit trail for any authorized individual. |
|
|
|
|
|
|
|
|
Logging Errors and Exceptions |
|
|
|
|
|
|
|
|
Logging errors and exceptions are also important for customer support and troubleshooting. The same important scenarios for logging transactions mentioned in the previous section are also the ones that tend to create the most problems for users. |
|
|
|
|
|
|
|
|
Logging Memory Allocations/Deallocations |
|
|
|
|
|
|
|
|
If you want even more detail, you might also record the allocation and deallocation of memory for your significant variables, particularly your business objects and subsystem interface objects. Sometimes, it is helpful to log the stack of function calls, but keep in mind that the more information you log, the more work your application must do. This can cost you in some performance if you abuse this valuable tool. Sticking to the significant transactions won't harm performance, so use this as a criteria for logging transactions. |
|
|
|
|
|
|
|
|
The Internal Application Manager Subsystem Object Model |
|
|
|
|
|
|
|
|
This subsystem is relatively simple to implement, though it can be tedious at times (see Figure 14.2). Generally, you model your application to create global objects in the CApplication class. For each allocation of memory, the instance of CApplication's |
|
|
|
|
|